package com.lucy.flow.domain.entity;

import com.lucy.common.core.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Getter;
import lombok.RequiredArgsConstructor;
import lombok.Setter;
import lombok.ToString;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;

/**
 * @author kindear
 * 流程处理记录
 */
@Getter
@Setter
@ToString
@RequiredArgsConstructor
@Entity
@Table(name = "flow_process")
@ApiModel(value = "流程处理",description = "")
public class FlowProcess extends BaseEntity implements Serializable {
    public FlowProcess(FlowWork flowWork){
        this.flowDefineId = flowWork.getFlowDefineId();
        this.flowDefineCode = flowWork.getFlowDefineCode();
        this.flowName = flowWork.getFlowName();
        this.flowWorkId = flowWork.getId();
        this.flowNodeId = flowWork.getCurrentNodeId();
        this.flowNodeName = flowWork.getCurrentNodeName();
    }
    @ApiModelProperty("流程定义ID")
    @Column(name = "flow_define_id")
    String flowDefineId;
    /**
     * 流程定义编码
     */
    @ApiModelProperty("流程定义编码")
    @Column(name = "flow_define_code")
    String flowDefineCode;

    @ApiModelProperty("流程名称")
    @Column(name = "flow_name")
    String flowName;

    @ApiModelProperty("流程实例ID")
    @Column(name = "flow_work_id")
    String flowWorkId;

    /**
     * 对应流程节点ID
     */
    @ApiModelProperty("流程节点ID")
    @Column(name = "flow_node_id")
    String flowNodeId;

    @ApiModelProperty("流程节点名称")
    @Column(name = "flow_node_name")
    String flowNodeName;



    @ApiModelProperty("操作人员ID")
    @Column(name = "user_id")
    String userId;

    /**
     * 处理结果 通过/拒绝
     */
    @ApiModelProperty("处理结果")
    @Column(name = "process_result")
    String processResult;

    @ApiModelProperty("批复意见")
    @Column(name = "remark",length = 1024)
    String remark;

}
